
#include    <iostream>

#include    "tiny/logger.hpp"

using namespace std;
using namespace tiny;

int test_dummy( void )
{
    cout << "==== dummy testing begin. =====\n";
    cout << "In this testing, you should see nothing output from logger.\n";

    Logger* pLogger = getLogger();
    pLogger->fatal(__FILE__, __LINE__, "This is FATAL log message.");
    pLogger->error(__FILE__, __LINE__, "This is ERROR log message.");
    pLogger->warn(__FILE__, __LINE__, "This is WARN log message.");
    pLogger->info(__FILE__, __LINE__, "This is INFO log message.");
    pLogger->debug(__FILE__, __LINE__, "This is DEBUG log message.");
    pLogger->trace(__FILE__, __LINE__, "This is TRACE log message.");

    cout << "==== dummy testing   end. =====\n";
    return  0;
}

int test_console( void )
{
    cout << "==== dummy testing begin. =====\n";
    cout << "In this testing, you should see some log-message output from logger when loglevel is high or equal INFO.\n";

    Logger::configure("console");

    Logger* pLogger = getLogger();
    pLogger->fatal(__FILE__, __LINE__, "This is FATAL log message.");
    pLogger->error(__FILE__, __LINE__, "This is ERROR log message.");
    pLogger->warn(__FILE__, __LINE__, "This is WARN log message.");
    pLogger->info(__FILE__, __LINE__, "This is INFO log message.");
    pLogger->debug(__FILE__, __LINE__, "This is DEBUG log message.");
    pLogger->trace(__FILE__, __LINE__, "This is TRACE log message.");

    cout << "==== dummy testing   end. =====\n";
    return  0;
}

int     main ( void )
{
    test_dummy();
    test_console();

    return  0;
}

